<?php $_categories = $this->getCurrentChildCategories() ?>
<?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?>
<?php if($_count): ?>
<div class="block block-category-nav">
    <div class="block-title">
        <strong><span><?php echo Mage::registry('current_category')->getName(); ?></span></strong>
    </div>
    <div class="block-content">
        <div class="akordeon category-list">
        <?php foreach ($_categories as $_category): ?>
            <?php if($_category->getIsActive()): ?>
            <?php
                $children = explode( ",", $_category->getChildren() );
            ?>
            <div class="akordeon-item <?php echo (!$children[0])?'has-no-children':'';?>">
                <div class="akordeon-item-head">
                    <div class="akordeon-item-head-container">
                        <div class="akordeon-heading">
                            <a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->htmlEscape($_category->getName()) ?></a>
                        </div>
                    </div>
                </div>
                <?php if($children[0]): ?>
                <div class="akordeon-item-body">
                    <div class="akordeon-item-content">
                        <ul>
                        <?php
                        foreach($children as $child){
                            $_subcat = Mage::getModel( 'catalog/category' )->load( $child );
                        ?>
                            <li>
                                <a href="<?php echo $this->getCategoryUrl($_subcat) ?>"<?php if ($this->isCategoryActive($_subcat)): ?> class="current"<?php endif; ?>><?php echo $this->htmlEscape($_subcat->getName()) ?></a>
                            </li>
                        <?php
                        }
                        ?>
                        </ul>
                    </div>
                </div>
                <?php endif; ?>
            </div>
            <?php endif; ?>
        <?php endforeach ?>
        </div>
    </div>
</div>
<script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery('.akordeon.category-list').akordeon({ buttons: true, toggle: true });
    });
</script>
<?php endif; ?>
